const fs = require("fs");
const path = require("path");

let filePath = path.join(__dirname, "01std-io.js");
let writePath = path.join(__dirname, "04write-to.js");

//可读流
let reader = fs.createReadStream(filePath);
//可写流
let writer = fs.createWriteStream(writePath);

//pipe管道，可以将流之间进行连接
//将可读流中的数据写入可写流对应的文件
reader.pipe(writer);